<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>BrokenIRC: server_src/commands_parsing.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">BrokenIRC
   &#160;<span id="projectnumber">0.0.42</span>
   </div>
   <div id="projectbrief">A &#39;not so functionnal&#39; irc server and a WIP client</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_20e5c1c74b8b955148e6b35ac4a0bc4d.html">server_src</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">commands_parsing.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &quot;<a class="el" href="server_8h_source.html">../include/server.h</a>&quot;</code><br />
<code>#include &lt;stdlib.h&gt;</code><br />
</div><div class="textblock"><div class="dynheader">
Include dependency graph for commands_parsing.c:</div>
<div class="dyncontent">
<div class="center"><img src="commands__parsing_8c__incl.png" border="0" usemap="#server__src_2commands__parsing_8c" alt=""/></div>
<map name="server__src_2commands__parsing_8c" id="server__src_2commands__parsing_8c">
<area shape="rect" id="node2" href="server_8h.html" title="../include/server.h" alt="" coords="150,95,277,121"/>
</map>
</div>
</div>
<p><a href="commands__parsing_8c_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a9bf380b201748032988ca121dc4ed068"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="commands__parsing_8c.html#a9bf380b201748032988ca121dc4ed068">free_buffers</a> (char **buffer)</td></tr>
<tr class="separator:a9bf380b201748032988ca121dc4ed068"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae88af3c7c8c827d710efa585d851a414"><td class="memItemLeft" align="right" valign="top">static char **&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="commands__parsing_8c.html#ae88af3c7c8c827d710efa585d851a414">get_commands</a> (char *req)</td></tr>
<tr class="separator:ae88af3c7c8c827d710efa585d851a414"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad7cc037b9642ffd85e521546772eceae"><td class="memItemLeft" align="right" valign="top">static char **&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="commands__parsing_8c.html#ad7cc037b9642ffd85e521546772eceae">get_args</a> (char *cmd)</td></tr>
<tr class="separator:ad7cc037b9642ffd85e521546772eceae"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac5949d17278df5e1ada98dca25ccd961"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="commands__parsing_8c.html#ac5949d17278df5e1ada98dca25ccd961">get_methods</a> (char *req, int clifd)</td></tr>
<tr class="separator:ac5949d17278df5e1ada98dca25ccd961"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a id="a9bf380b201748032988ca121dc4ed068"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9bf380b201748032988ca121dc4ed068">&#9670;&nbsp;</a></span>free_buffers()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void free_buffers </td>
          <td>(</td>
          <td class="paramtype">char **&#160;</td>
          <td class="paramname"><em>buffer</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Free the token list </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">buffer</td><td>the 2D array to be free'd </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="commands__parsing_8c_source.html#l00014">14</a> of file <a class="el" href="commands__parsing_8c_source.html">commands_parsing.c</a>.</p>

<p class="reference">Referenced by <a class="el" href="commands__parsing_8c_source.html#l00073">get_methods()</a>.</p>
<div class="fragment"><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;{</div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;        <span class="keywordtype">int</span> i;</div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;</div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;        <span class="keywordflow">for</span> (i = 0; buffer[i]; ++i) {</div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;                free(buffer[i]);</div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;        }</div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;        free(buffer);</div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;}</div></div><!-- fragment --><div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="commands__parsing_8c_a9bf380b201748032988ca121dc4ed068_icgraph.png" border="0" usemap="#commands__parsing_8c_a9bf380b201748032988ca121dc4ed068_icgraph" alt=""/></div>
<map name="commands__parsing_8c_a9bf380b201748032988ca121dc4ed068_icgraph" id="commands__parsing_8c_a9bf380b201748032988ca121dc4ed068_icgraph">
<area shape="rect" id="node2" href="server_8h.html#ac5949d17278df5e1ada98dca25ccd961" title="get_methods" alt="" coords="144,5,241,32"/>
<area shape="rect" id="node3" href="server__main_8c.html#a4178685c6a99dba7611faf9fe58f1a54" title="evhandler" alt="" coords="289,5,368,32"/>
<area shape="rect" id="node4" href="server__main_8c.html#a825c9cedc1751b000c44487b4233c37c" title="getactiveclients" alt="" coords="416,5,529,32"/>
<area shape="rect" id="node5" href="server__main_8c.html#af3e041546aaed3cd242c2b0e77162b39" title="server" alt="" coords="577,5,636,32"/>
<area shape="rect" id="node6" href="server__main_8c.html#a0c99d968a34e803d378692bde2e3f18f" title="main" alt="" coords="684,5,735,32"/>
</map>
</div>

</div>
</div>
<a id="ad7cc037b9642ffd85e521546772eceae"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad7cc037b9642ffd85e521546772eceae">&#9670;&nbsp;</a></span>get_args()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static char** get_args </td>
          <td>(</td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>cmd</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Tokenize the command buffer by splitting by spaces </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">cmd</td><td>a command string received after <a class="el" href="commands__parsing_8c.html#ae88af3c7c8c827d710efa585d851a414">get_commands()</a> tokenization </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="commands__parsing_8c_source.html#l00049">49</a> of file <a class="el" href="commands__parsing_8c_source.html">commands_parsing.c</a>.</p>

<p class="reference">References <a class="el" href="server_8h_source.html#l00035">MAXARGS</a>.</p>

<p class="reference">Referenced by <a class="el" href="commands__parsing_8c_source.html#l00073">get_methods()</a>.</p>
<div class="fragment"><div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;{</div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;        <span class="keywordtype">int</span> i = 0;</div><div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;        <span class="keywordtype">char</span> *token = NULL;</div><div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;        <span class="keywordtype">char</span> **tkns = malloc(<a class="code" href="server_8h.html#a41101847771d39a4f0a7f9395061c629">MAXARGS</a> * <span class="keyword">sizeof</span>(*tkns));</div><div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;</div><div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;        <span class="keywordflow">if</span> (tkns) {</div><div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;                memset(tkns, 0, <span class="keyword">sizeof</span>(*tkns) * <a class="code" href="server_8h.html#a41101847771d39a4f0a7f9395061c629">MAXARGS</a>);</div><div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;                token = strtok(cmd, <span class="stringliteral">&quot; :&quot;</span>);</div><div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;                <span class="keywordflow">while</span> (token) {</div><div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;                        tkns[i] = strdup(token);</div><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;                        token = strtok(NULL, <span class="stringliteral">&quot; :&quot;</span>);</div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;                        i = i &lt;= <a class="code" href="server_8h.html#a41101847771d39a4f0a7f9395061c629">MAXARGS</a> ? i + 1 : i;</div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;                }</div><div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;        }</div><div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;        <span class="keywordflow">return</span> (tkns);</div><div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;}</div><div class="ttc" id="server_8h_html_a41101847771d39a4f0a7f9395061c629"><div class="ttname"><a href="server_8h.html#a41101847771d39a4f0a7f9395061c629">MAXARGS</a></div><div class="ttdeci">#define MAXARGS</div><div class="ttdef"><b>Definition:</b> <a href="server_8h_source.html#l00035">server.h:35</a></div></div>
</div><!-- fragment --><div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="commands__parsing_8c_ad7cc037b9642ffd85e521546772eceae_icgraph.png" border="0" usemap="#commands__parsing_8c_ad7cc037b9642ffd85e521546772eceae_icgraph" alt=""/></div>
<map name="commands__parsing_8c_ad7cc037b9642ffd85e521546772eceae_icgraph" id="commands__parsing_8c_ad7cc037b9642ffd85e521546772eceae_icgraph">
<area shape="rect" id="node2" href="server_8h.html#ac5949d17278df5e1ada98dca25ccd961" title="get_methods" alt="" coords="125,5,223,32"/>
<area shape="rect" id="node3" href="server__main_8c.html#a4178685c6a99dba7611faf9fe58f1a54" title="evhandler" alt="" coords="271,5,349,32"/>
<area shape="rect" id="node4" href="server__main_8c.html#a825c9cedc1751b000c44487b4233c37c" title="getactiveclients" alt="" coords="397,5,511,32"/>
<area shape="rect" id="node5" href="server__main_8c.html#af3e041546aaed3cd242c2b0e77162b39" title="server" alt="" coords="559,5,617,32"/>
<area shape="rect" id="node6" href="server__main_8c.html#a0c99d968a34e803d378692bde2e3f18f" title="main" alt="" coords="665,5,716,32"/>
</map>
</div>

</div>
</div>
<a id="ae88af3c7c8c827d710efa585d851a414"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae88af3c7c8c827d710efa585d851a414">&#9670;&nbsp;</a></span>get_commands()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static char** get_commands </td>
          <td>(</td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>req</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Split the received buffer by the '\r\n' symbol to get multiple commands in one buffer (or only one it's all depends on the client) </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">req</td><td>the read() buffer from clifd </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="commands__parsing_8c_source.html#l00028">28</a> of file <a class="el" href="commands__parsing_8c_source.html">commands_parsing.c</a>.</p>

<p class="reference">References <a class="el" href="server_8h_source.html#l00035">MAXARGS</a>.</p>

<p class="reference">Referenced by <a class="el" href="commands__parsing_8c_source.html#l00073">get_methods()</a>.</p>
<div class="fragment"><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;{</div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;        <span class="keywordtype">int</span> i = 0;</div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;        <span class="keywordtype">char</span> *cmd = NULL;</div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;        <span class="keywordtype">char</span> **<a class="code" href="server_8h.html#abc9c1e6f561b7500f7ecb3813d272d20">cmds</a> = malloc(<a class="code" href="server_8h.html#a41101847771d39a4f0a7f9395061c629">MAXARGS</a> * <span class="keyword">sizeof</span>(*cmds));</div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;</div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;        <span class="keywordflow">if</span> (cmds) {</div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;                memset(cmds, 0, <span class="keyword">sizeof</span>(*cmds) * <a class="code" href="server_8h.html#a41101847771d39a4f0a7f9395061c629">MAXARGS</a>);</div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;                cmd = strtok(req, <span class="stringliteral">&quot;\r\n&quot;</span>);</div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;                <span class="keywordflow">while</span> (cmd) {</div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;                        cmds[i] = strdup(cmd);</div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;                        cmd = strtok(NULL, <span class="stringliteral">&quot;\r\n&quot;</span>);</div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;                        i = i &lt;= <a class="code" href="server_8h.html#a41101847771d39a4f0a7f9395061c629">MAXARGS</a> ? i + 1 : i;</div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;                }</div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;        }</div><div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;        <span class="keywordflow">return</span> (cmds);</div><div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;}</div><div class="ttc" id="server_8h_html_a41101847771d39a4f0a7f9395061c629"><div class="ttname"><a href="server_8h.html#a41101847771d39a4f0a7f9395061c629">MAXARGS</a></div><div class="ttdeci">#define MAXARGS</div><div class="ttdef"><b>Definition:</b> <a href="server_8h_source.html#l00035">server.h:35</a></div></div>
<div class="ttc" id="server_8h_html_abc9c1e6f561b7500f7ecb3813d272d20"><div class="ttname"><a href="server_8h.html#abc9c1e6f561b7500f7ecb3813d272d20">cmds</a></div><div class="ttdeci">void *(* cmds)(cmdargs args, int clifd, t_channel *chanlist)</div><div class="ttdef"><b>Definition:</b> <a href="server_8h_source.html#l00175">server.h:175</a></div></div>
</div><!-- fragment --><div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="commands__parsing_8c_ae88af3c7c8c827d710efa585d851a414_icgraph.png" border="0" usemap="#commands__parsing_8c_ae88af3c7c8c827d710efa585d851a414_icgraph" alt=""/></div>
<map name="commands__parsing_8c_ae88af3c7c8c827d710efa585d851a414_icgraph" id="commands__parsing_8c_ae88af3c7c8c827d710efa585d851a414_icgraph">
<area shape="rect" id="node2" href="server_8h.html#ac5949d17278df5e1ada98dca25ccd961" title="get_methods" alt="" coords="164,5,261,32"/>
<area shape="rect" id="node3" href="server__main_8c.html#a4178685c6a99dba7611faf9fe58f1a54" title="evhandler" alt="" coords="309,5,388,32"/>
<area shape="rect" id="node4" href="server__main_8c.html#a825c9cedc1751b000c44487b4233c37c" title="getactiveclients" alt="" coords="436,5,549,32"/>
<area shape="rect" id="node5" href="server__main_8c.html#af3e041546aaed3cd242c2b0e77162b39" title="server" alt="" coords="597,5,656,32"/>
<area shape="rect" id="node6" href="server__main_8c.html#a0c99d968a34e803d378692bde2e3f18f" title="main" alt="" coords="704,5,755,32"/>
</map>
</div>

</div>
</div>
<a id="ac5949d17278df5e1ada98dca25ccd961"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac5949d17278df5e1ada98dca25ccd961">&#9670;&nbsp;</a></span>get_methods()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int get_methods </td>
          <td>(</td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>req</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>clifd</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Match all methods in G_CMDS for a given req command string </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">req</td><td>the readed commands buffer </td></tr>
    <tr><td class="paramname">clifd</td><td>the client socket fd </td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>could add compilation macro for debug print_2darray() calls but epitech norm insist on 20 line per function so ... </dd></dl>

<p class="definition">Definition at line <a class="el" href="commands__parsing_8c_source.html#l00073">73</a> of file <a class="el" href="commands__parsing_8c_source.html">commands_parsing.c</a>.</p>

<p class="reference">References <a class="el" href="commands__parsing_8c_source.html#l00014">free_buffers()</a>, <a class="el" href="server__decls_8c_source.html#l00018">G_CMDS</a>, <a class="el" href="server__decls_8c_source.html#l00012">G_PROTOS</a>, <a class="el" href="commands__parsing_8c_source.html#l00049">get_args()</a>, <a class="el" href="commands__parsing_8c_source.html#l00028">get_commands()</a>, <a class="el" href="channel__list_8c_source.html#l00089">init_default_channel()</a>, <a class="el" href="logs__helpers_8c_source.html#l00017">print_users_in_chans()</a>, and <a class="el" href="server_8h_source.html#l00022">REF_NB</a>.</p>

<p class="reference">Referenced by <a class="el" href="server__main_8c_source.html#l00043">evhandler()</a>.</p>
<div class="fragment"><div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;{</div><div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;        <span class="keywordtype">int</span> index = 0;</div><div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;        <span class="keywordtype">char</span> **<a class="code" href="server_8h.html#abc9c1e6f561b7500f7ecb3813d272d20">cmds</a> = <a class="code" href="commands__parsing_8c.html#ae88af3c7c8c827d710efa585d851a414">get_commands</a>(req);</div><div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;        <span class="keywordtype">char</span> **args = NULL;</div><div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;        <span class="keyword">static</span> <a class="code" href="structt__channel.html">t_channel</a> *defchan = NULL;</div><div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;</div><div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;        defchan = !defchan ? <a class="code" href="channel__list_8c.html#a1c3fc93845d179d198452e745f3460b1">init_default_channel</a>() : defchan;</div><div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;        <span class="keywordflow">for</span> (<span class="keywordtype">int</span> j = 0; cmds[j]; ++j) {</div><div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;                <span class="keywordflow">for</span> (index = 0; <a class="code" href="server__decls_8c.html#ae19e01ff7678899828036520edec313c">G_PROTOS</a>[index]; ++index) {</div><div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;                        <span class="keywordflow">if</span> ((strstr(cmds[j], <a class="code" href="server__decls_8c.html#ae19e01ff7678899828036520edec313c">G_PROTOS</a>[index]))) {</div><div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;                                args = <a class="code" href="commands__parsing_8c.html#ad7cc037b9642ffd85e521546772eceae">get_args</a>(cmds[j]);</div><div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;                                <a class="code" href="server__decls_8c.html#a7bb29231b69e3767e187ffe5d5717b28">G_CMDS</a>[index](args, clifd, defchan);</div><div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;                                <a class="code" href="commands__parsing_8c.html#a9bf380b201748032988ca121dc4ed068">free_buffers</a>(args);</div><div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;                                <span class="keywordflow">break</span>;</div><div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;                        }</div><div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;                }</div><div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;        }</div><div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;        <a class="code" href="logs__helpers_8c.html#a805324e4c542079956ff84a290274d23">print_users_in_chans</a>(defchan, index);</div><div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;        <a class="code" href="commands__parsing_8c.html#a9bf380b201748032988ca121dc4ed068">free_buffers</a>(cmds);</div><div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;        <span class="keywordflow">return</span> ((index == <a class="code" href="server_8h.html#a9880cfe1f4eb3140da2095fd081282f5">REF_NB</a>) ? (0) : (index));</div><div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;}</div><div class="ttc" id="logs__helpers_8c_html_a805324e4c542079956ff84a290274d23"><div class="ttname"><a href="logs__helpers_8c.html#a805324e4c542079956ff84a290274d23">print_users_in_chans</a></div><div class="ttdeci">void print_users_in_chans(t_channel *chanlist, int index)</div><div class="ttdef"><b>Definition:</b> <a href="logs__helpers_8c_source.html#l00017">logs_helpers.c:17</a></div></div>
<div class="ttc" id="server__decls_8c_html_a7bb29231b69e3767e187ffe5d5717b28"><div class="ttname"><a href="server__decls_8c.html#a7bb29231b69e3767e187ffe5d5717b28">G_CMDS</a></div><div class="ttdeci">const cmds G_CMDS[REF_NB]</div><div class="ttdef"><b>Definition:</b> <a href="server__decls_8c_source.html#l00018">server_decls.c:18</a></div></div>
<div class="ttc" id="commands__parsing_8c_html_a9bf380b201748032988ca121dc4ed068"><div class="ttname"><a href="commands__parsing_8c.html#a9bf380b201748032988ca121dc4ed068">free_buffers</a></div><div class="ttdeci">static void free_buffers(char **buffer)</div><div class="ttdef"><b>Definition:</b> <a href="commands__parsing_8c_source.html#l00014">commands_parsing.c:14</a></div></div>
<div class="ttc" id="commands__parsing_8c_html_ad7cc037b9642ffd85e521546772eceae"><div class="ttname"><a href="commands__parsing_8c.html#ad7cc037b9642ffd85e521546772eceae">get_args</a></div><div class="ttdeci">static char ** get_args(char *cmd)</div><div class="ttdef"><b>Definition:</b> <a href="commands__parsing_8c_source.html#l00049">commands_parsing.c:49</a></div></div>
<div class="ttc" id="commands__parsing_8c_html_ae88af3c7c8c827d710efa585d851a414"><div class="ttname"><a href="commands__parsing_8c.html#ae88af3c7c8c827d710efa585d851a414">get_commands</a></div><div class="ttdeci">static char ** get_commands(char *req)</div><div class="ttdef"><b>Definition:</b> <a href="commands__parsing_8c_source.html#l00028">commands_parsing.c:28</a></div></div>
<div class="ttc" id="server_8h_html_a9880cfe1f4eb3140da2095fd081282f5"><div class="ttname"><a href="server_8h.html#a9880cfe1f4eb3140da2095fd081282f5">REF_NB</a></div><div class="ttdeci">#define REF_NB</div><div class="ttdef"><b>Definition:</b> <a href="server_8h_source.html#l00022">server.h:22</a></div></div>
<div class="ttc" id="structt__channel_html"><div class="ttname"><a href="structt__channel.html">t_channel</a></div><div class="ttdef"><b>Definition:</b> <a href="server_8h_source.html#l00121">server.h:121</a></div></div>
<div class="ttc" id="channel__list_8c_html_a1c3fc93845d179d198452e745f3460b1"><div class="ttname"><a href="channel__list_8c.html#a1c3fc93845d179d198452e745f3460b1">init_default_channel</a></div><div class="ttdeci">t_channel * init_default_channel(void)</div><div class="ttdef"><b>Definition:</b> <a href="channel__list_8c_source.html#l00089">channel_list.c:89</a></div></div>
<div class="ttc" id="server__decls_8c_html_ae19e01ff7678899828036520edec313c"><div class="ttname"><a href="server__decls_8c.html#ae19e01ff7678899828036520edec313c">G_PROTOS</a></div><div class="ttdeci">const char * G_PROTOS[REF_NB]</div><div class="ttdef"><b>Definition:</b> <a href="server__decls_8c_source.html#l00012">server_decls.c:12</a></div></div>
<div class="ttc" id="server_8h_html_abc9c1e6f561b7500f7ecb3813d272d20"><div class="ttname"><a href="server_8h.html#abc9c1e6f561b7500f7ecb3813d272d20">cmds</a></div><div class="ttdeci">void *(* cmds)(cmdargs args, int clifd, t_channel *chanlist)</div><div class="ttdef"><b>Definition:</b> <a href="server_8h_source.html#l00175">server.h:175</a></div></div>
</div><!-- fragment --><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="commands__parsing_8c_ac5949d17278df5e1ada98dca25ccd961_cgraph.png" border="0" usemap="#commands__parsing_8c_ac5949d17278df5e1ada98dca25ccd961_cgraph" alt=""/></div>
<map name="commands__parsing_8c_ac5949d17278df5e1ada98dca25ccd961_cgraph" id="commands__parsing_8c_ac5949d17278df5e1ada98dca25ccd961_cgraph">
<area shape="rect" id="node2" href="commands__parsing_8c.html#a9bf380b201748032988ca121dc4ed068" title="free_buffers" alt="" coords="178,5,269,32"/>
<area shape="rect" id="node3" href="commands__parsing_8c.html#ad7cc037b9642ffd85e521546772eceae" title="get_args" alt="" coords="187,56,259,83"/>
<area shape="rect" id="node4" href="commands__parsing_8c.html#ae88af3c7c8c827d710efa585d851a414" title="get_commands" alt="" coords="168,107,279,133"/>
<area shape="rect" id="node5" href="channel__list_8c.html#a1c3fc93845d179d198452e745f3460b1" title="init_default_channel" alt="" coords="155,157,292,184"/>
<area shape="rect" id="node8" href="logs__helpers_8c.html#a805324e4c542079956ff84a290274d23" title="print_users_in_chans" alt="" coords="151,208,296,235"/>
<area shape="rect" id="node6" href="user__list_8c.html#ace045c243817cc0c9885bdf3b41263c0" title="get_new_user" alt="" coords="353,107,455,133"/>
<area shape="rect" id="node7" href="user__list_8c.html#a1cf3d818bc2607cb0f69c043dba3c039" title="get_new_userlist" alt="" coords="344,157,464,184"/>
<area shape="rect" id="node9" href="logs__helpers_8c.html#a45c9c768c2486ac046ac242d3c46aadb" title="print_users" alt="" coords="361,208,447,235"/>
</map>
</div>
<div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="commands__parsing_8c_ac5949d17278df5e1ada98dca25ccd961_icgraph.png" border="0" usemap="#commands__parsing_8c_ac5949d17278df5e1ada98dca25ccd961_icgraph" alt=""/></div>
<map name="commands__parsing_8c_ac5949d17278df5e1ada98dca25ccd961_icgraph" id="commands__parsing_8c_ac5949d17278df5e1ada98dca25ccd961_icgraph">
<area shape="rect" id="node2" href="server__main_8c.html#a4178685c6a99dba7611faf9fe58f1a54" title="evhandler" alt="" coords="151,5,229,32"/>
<area shape="rect" id="node3" href="server__main_8c.html#a825c9cedc1751b000c44487b4233c37c" title="getactiveclients" alt="" coords="277,5,391,32"/>
<area shape="rect" id="node4" href="server__main_8c.html#af3e041546aaed3cd242c2b0e77162b39" title="server" alt="" coords="439,5,497,32"/>
<area shape="rect" id="node5" href="server__main_8c.html#a0c99d968a34e803d378692bde2e3f18f" title="main" alt="" coords="545,5,596,32"/>
</map>
</div>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>
